/**
 * Created with JetBrains WebStorm.
 * User: Administrator
 * Date: 15-11-6
 * Time: 上午8:46
 * To change this template use File | Settings | File Templates.
 */
window.onload=function(){
    var url = getUrl();
    $.jsonp({
        url: 'http://'+url+'/api/recommend/shops/4/list',
        data: {type:4},
        callbackParameter: "callback",
        success: function (data, textStatus, xOptions) {
            $.each(data.arrays,function(index,item){
                if(item.supplierType=="美食"){
                    var html ='<a href="meishi_shangjiadetail.html?shopId='+item.id+'">'+
                        '<div class="ui-source-pic w_gfsq">'+
                        '<img src="'+item.photos+'" alt="">'+
                        '<h3>美食商铺</h3></div></a>' ;
                }else if(item.supplierType=="艺人"){
                    var html ='<a href="yiren_detail.html?shopId='+item.id+'">'+
                        '<div class="ui-source-pic w_gfsq">'+
                        '<img src="'+item.photos+'" alt="">'+
                        '<h3>艺人商铺</h3></div></a>' ;
                }else{
                    var html ='<a href="jiudian_shangjiadetail.html?shopId='+item.id+'">'+
                        '<div class="ui-source-pic w_gfsq">'+
                        '<img src="'+item.photos+'" alt="">'+
                        '<h3>酒店商铺</h3></div></a>' ;
                }
                $(".wrapper").append(html);
            });
        },
        error: function (xOptions, textStatus) {}
    });
}